package com.dao.Impl;

import com.dao.CityDao;
import com.util.JDBC;

import java.util.List;
import java.util.Map;

public class CityDaoImpl implements CityDao {
    @Override
    public List<Map> findAllCity() {
        List<Map> list = JDBC.selectMap("select city,pid from city ");
        if (list.size()>0){
            return list;
        }else {
            return null;
        }
    }


    @Override
    public List<Map> findCityPid(int pid) {
        List<Map> list = JDBC.selectMap("select city from city where pid=?", pid);
        if (list.size()>0){
            return list;
        }else {
            return null;

        }
    }
}
